/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



package sonia.golf.dao;

//~--- JDK imports ------------------------------------------------------------

import java.util.List;

/**
 *
 * @author Sebastian Sdorra
 *
 * @param <T> Type
 * @param <K> Key
 */
public interface GenericDAO<T, K>
{

  /**
   * Method description
   *
   *
   * @param item
   */
  public void add(T item);

  /**
   * Method description
   *
   *
   * @param listener
   */
  public void addListener(DAOListener<T> listener);

  /**
   * Method description
   *
   *
   * @return
   */
  public long count();

  /**
   * Method description
   *
   *
   * @param item
   */
  public void remove(T item);

  /**
   * Method description
   *
   *
   * @param listener
   */
  public void removeListener(DAOListener<T> listener);

  /**
   * Method description
   *
   *
   * @param item
   */
  public void update(T item);

  //~--- get methods ----------------------------------------------------------

  /**
   * Method description
   *
   *
   * @param id
   *
   * @return
   */
  public T get(K id);

  /**
   * Method description
   *
   *
   * @return
   */
  public List<T> getAll();
}
